<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>
        小程序商城管理平台
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../css/x-admin.css" media="all">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=/DD279b2a90afdf0ae7a3796787a0742e/"></script>
    <script src="webjars/jquery/3.3.1/jquery.js"></script>
    <script src="../../lib/layui/layui.all.js"></script>
    <script src="../../lib/layui/layui.js" charset="utf-8"></script>
    <!--引入jquery-->
    <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script><title>地址解析</title>

    <style type="text/css">
        html{height:100%}
        body{height:100%;margin:0px;padding:0px}
        #contZhi{height:100%}
    </style>
    <style>
        /*背景层*/
        #popLayer {
            display: none;
            background-color: #B3B3B3;
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 10;
            -moz-opacity: 0.8;
            opacity: .80;
            filter: alpha(opacity=80); /* 只支持IE6、7、8、9 */
        }

        /*弹出层*/
        #popBox {
            display: none;
            background-color: #FFFFFF;
            z-index: 11;
            width: 500px;
            height: 510px;
            position: fixed;
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
            margin: auto;
        }

        #popBox .close {
            text-left: 40px;
            margin-right: 5px;
            height: 40px;
            line-height: 40px;
            color: #e7e7e7;
            background-color: #F8F8F8;
        }

        /*关闭按钮*/
        #popBox .close a {
            text-decoration: none;
            color: #2D2C3B;
        }

        .pop {
            padding: 12px;
            position: relative;
            left: 150px;
        }

    </style>
</head>
<!--<body onblur="self.focus()">-->
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <a class="logo" href="index.html">
                一站式商城管理平台
            </a>
            <ul class="layui-nav" lay-filter="">
                <li class="layui-nav-item"><img src="../images/logo.png" class="layui-circle" style="border: 2px solid #A9B7B7;" width="35px" alt=""></li>
                <li class="layui-nav-item">
                    <a href="javascript:;">admin</a>
                    <dl class="layui-nav-child"> <!-- 二级菜单 -->
                        <dd><a href="">个人中心</a></dd>
                        <dd><a href="../logout">退出</a></dd>
                    </dl>
                </li>
                <!-- <li class="layui-nav-item">
                  <a href="" title="消息">
                      <i class="layui-icon" style="top: 1px;">&#xe63a;</i>
                  </a>
                  </li> -->
                <li class="layui-nav-item x-index"><a th:href="@{'../index'}">首页</a></li>
            </ul>
        </div>
    </div>
    <div class="layui-side layui-bg-black x-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe607;</i><cite>会员管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../user/toUserList'}">
                                <cite>用户列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../user/toAdminList'}">
                                <cite>管理员管理</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../user/toRoleList'}">
                                <cite>角色管理</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../user/toNoteList'}">
                                <cite>短信管理</cite>
                            </a>
                        </dd>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe62d;</i><cite>商品管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toCommodityList'}">
                                <cite>商品列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toClassifyList'}">
                                <cite>商品分类</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toTradeTrademarkList'}">
                                <cite>品牌列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toMoldList'}">
                                <cite>商品类型</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toParameterList'}">
                                <cite>商品属性</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toPropertyList'}">
                                <cite>参数列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../commodity/toEvaluateList'}">
                                <cite>商品评价</cite>
                            </a>
                        </dd>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe634;</i><cite>订单管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../order/orderlist'}">
                                <cite>订单列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../invoice/invoicelist'}">
                                <cite>发货单列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../billoflading/BillListAll'}">
                                <cite>提货单列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../aftersale/aftersalelist'}">
                                <cite>售后单列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../return/returnlist'}">
                                <cite>退货单列表</cite>
                            </a>
                        </dd>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe642;</i><cite>运营管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../Article/Articlelist'}">
                                <cite>文章列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../notice/noticelist'}">
                                <cite>公告列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../ArticleType/ArticleTypelist'}">
                                <cite>文章分类</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../Advertising/Advertisinglist'}">
                                <cite>广告列表</cite>
                            </a>
                        </dd>
                        </dd>
                        <dd class="">
                        <dd class="">
                            <a th:href="@{'../Advertisingspace/Advertisingspacelist'}">
                                <cite>广告位列表</cite>
                            </a>
                        </dd>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe630;</i><cite>促销管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                            <a th:href="@{'../promotion/seckillList'}">
                                <cite>团购秒杀列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../coupon/couponList'}">
                                <cite>优惠券列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../sales/salesList'}">
                                <cite>促销列表</cite>
                            </a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe606;</i><cite>财务管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                            <a th:href="@{'../paylist'}">
                                <cite>支付单列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../withdlist'}">
                                <cite>提现列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../metlist'}">
                                <cite>支付方式列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../retlist'}">
                                <cite>退款单列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../acclist'}">
                                <cite>账户资金管理</cite>
                            </a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe612;</i><cite>控制面板</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                            <a th:href="@{'../explist'}">
                                <cite>导入导出</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../piclist'}">
                                <cite>图片列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../stolist'}">
                                <cite>门店列表</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../log/loglist'}">
                                <cite>操作日志</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../logisticsCompany/getLogistics'}">
                                <cite>物流公司列表</cite>
                            </a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="javascript:;" href="javascript:;">
                        <i class="layui-icon" style="top: 3px;">&#xe613;</i><cite>微信管理</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                            <a th:href="@{'../official/getOfficial'}">
                                <cite>公众号配置</cite>
                            </a>
                        </dd>
                        <dd class="">
                            <a th:href="@{'../official/getApplet'}">
                                <cite>小程序配置</cite>
                            </a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>

    </div>
    <div class="layui-tab layui-tab-card site-demo-title x-main" lay-filter="x-tab" lay-allowclose="true">
        <div class="x-slide_left"></div>

        <div style="padding: 15px;overflow-y:auto; overflow-x:auto; width:1109px; height:500px">
            <span class="layui-breadcrumb" style="visibility: visible;">
                <i class="iconfont icon-shouyeshouye"></i>
                                        <a href="/manage/index/index.html">控制面板</a><span lay-separator="">/</span>
                                            <a th:href="@{stolist}">门店列表</a><span
                    lay-separator="">/</span>
                                            <a><cite>门店列表(门店添加)</cite></a><br/>
                                </span>
            <div class="layui-form seller-alone-form" >
                <div class="layui-form-item">
                    <form action="stoAdd" method="post" enctype="multipart/form-data" name="form" style="font-size: 12px;">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><i style="color: red;">*</i>门店名称：</label>
                            <div class="layui-input-inline seller-inline-4">
                                <input type="text" name="store" lay-verify="required" placeholder="请输入门店名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><i style="color: red;">*</i>手机号：</label>
                            <div class="layui-input-inline seller-inline-4">
                                <input type="text" name="store_phone" lay-verify="required" placeholder="请输入手机号" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><i style="color: red;">*</i>联系人：</label>
                            <div class="layui-input-inline seller-inline-4">
                                <input type="text" name="linkman" lay-verify="required" placeholder="请输入联系人名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">门店LOGO：</label>
                            <div class="layui-input-inline seller-inline-3">
                                <input type="file" name="files" id="files" accept="image/*"></input>
                                <button type="button" id="img" class="layui-btn" >上传图片</button>
                                <div class="layui-upload-list" id="upload">
                                    <p id="upload_text_logo"></p>
                                </div>
                                <input class="layui-upload-file" type="hidden" name="logo"  id="image_value_logo" value="">
                                <textarea id="edit_logo" style="display: none;"></textarea>
                            </div>
                        </div>
                        <label class="layui-form-label"><i style="color: red;">*</i>地区选择：</label>
                        <div class="layui-input-inline seller-inline-4 address-class" id="store">
                            <div class="layui-form-item">
                                <div class="layui-input-inline">
                                    <select id="provinceid" name="provinceid"
                                            model="select" lay-filter="provinceid" lay-verify="required" lay-search="">
                                        <option value="">请选择</option>
                                            <option th:each="pro:${proList}" th:value="${pro.provinceid}" th:text="${pro.province}"></option>
                                    </select>
                                </div>
                                <div class="layui-input-inline">
                                    <select id="cityid" name="cityid"
                                            model="select" lay-filter="cityid" lay-verify="required" lay-search="">
                                    </select>
                                </div>
                                <div class="layui-input-inline">
                                    <select id="areas" name="areas"
                                            model="select" lay-filter="areas" lay-verify="required" lay-search="">
                                    </select>
                                </div>
                            </div>
                        </div><br/><br/>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><i style="color: red;">*</i>详细地址：</label>
                                    <div class="layui-input-inline seller-inline-6">
                                        <input type="text" name="address" required lay-verify="required" placeholder="请输入门店详细地址" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                        <br/>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <input type="submit" class="layui-btn" lay-submit="" lay-filter="add-clerk" value="保存" id="myBtn"></input>
                                <button type="button" onclick="javascript:history.back(-1);"
                                        class="layui-btn layui-btn-primary">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <div>
            </div>
        </div>

        <div class="layui-table-page layui-hide">
            <div id="layui-table-page1"></div>
        </div>

        <script>
        </script>

    </div>
    <span class="layui-layer-setwin"><a class="layui-layer-ico layui-layer-close layui-layer-close1"
                                        href="javascript:;"></a></span><span class="layui-layer-resize"></span>
</div>

<div id="popLayer"></div>
<div id="popBox">
    <div class="close">
        <span style="padding: 12px;color: #0C0C0C;">&nbsp;&nbsp;门店坐标</span>
        <span style="padding: 12px;left: 460px;top: -12px;font-size: 24px;position: absolute;">
                <a href="javascript:void(0)" onclick="closeBox()">×</a>
            </span>
    </div>
    <div class="content">
        <div name="contZhi" id="contZhi">
        </div>
    </div>
    <script>


    </script>
</div>
<script>
    $("#files").hide();
    $(function () {
        $("#img").click(function () {
            $("#files").click();
        })
        $(document).on('change', '#files', function () {
            function getObjectURL(file) {
                var url = null;
                if (window.createObjcectURL != undefined) {
                    url = window.createOjcectURL(file);
                } else if (window.URL != undefined) {
                    url = window.URL.createObjectURL(file);
                } else if (window.webkitURL != undefined) {
                    url = window.webkitURL.createObjectURL(file);
                }
                return url;
            }
            var objURL = getObjectURL(this.files[0]);
            $("#upload").html('<img class=\"layui-upload-img\"  src=\"'+objURL+'\" id=\"image_src_logo\" style=\"width:90px;height:90px;\" >');
        });
    });
    $("[name=form]").submit(function () {
        var store_name = $("[name=store]").val();
        var store_phone = $("[name=store_phone]").val();
        var linkman = $("[name=cityid]").val();
        var provinceid = $("[name=provinceid]").val();
        var cityid = $("[name=cityid]").val();
        var areas = $("[name=areas]").val();
        var address = $("[name=address]").val();
        var myreg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/;
        if(store_name==null && store_name=="" && store_phone==null && store_phone=="" && linkman==null && linkman=="" && address=="" && address!=null){
            alert("请填写完整！");
            return false;
        }
        if(myreg.test(store_phone)==false){
            alert("手机号格式错误！");
            return false;
        }
        if(provinceid==null && provinceid=="" && provinceid=="请选择"){
            alert("请选择省份！");
            return false;
        }
        if(cityid==null && cityid=="" && cityid=="请选择"){
            alert("请选择城市！");
            return false;
        }
        if(areas==null && areas=="" && areas=="请选择"){
            alert("请选择市区！");
            return false;
        }
        return true;
    });
</script>
</div>
<div class="site-mobile-shade">
</div>
</div>
<!--<script src="../../lib/layui/layui.js" charset="utf-8"></script>-->
<script src="../../js/x-admin.js"></script>
<script>
    layui.use('form', function () {  //此段代码必不可少
        var form = layui.form,
            layer = layui.layer,//选择模块
            $ = layui.jquery;
        form.render();

        form.on('select(provinceid)', function(data){
            $("#cityid").html('');
            $("#areas").html('');
            $.ajax({
                url:'/getPca',
                data:{'provinceid':data.value},
                dataType:'json',
                async:false,
                success:function (data) {
                    var str="<option value=\"\" selected>请选择</option>";
                    if(data.citList!=null) {
                        for (var i = 0, len = data.citList.length; i < len; i++) {
                            str += "<option value=\"" + data.citList[i].cityid + "\" >" + data.citList[i].city + "</option>";
                        }
                    }
                    $("#cityid").html(str);
                    form.render();
                }
            })
        });

        form.on('select(cityid)', function(data){
            $("#areas").html('');
            $.ajax({
                url:'/getPca',
                data:{'areas':data.value},
                dataType:'json',
                async:false,
                success:function (data) {
                    var str="<option value=\"\" selected>请选择</option>";
                    if(data.areList!=null) {
                        for (var i = 0, len = data.areList.length; i < len; i++) {
                            str += "<option value=\"" + data.areList[i].areaid + "\" >" + data.areList[i].area + "</option>";
                        }
                    }
                    $("#areas").html(str);
                    form.render();
                }
            })
        });
    });
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>
